<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setAttribute("basePath", basePath);
String opNumberInfoJson= (String)request.getAttribute("opNumberInfoJson");
String success= (String)request.getAttribute("success");
%>
<link rel="stylesheet" href="${basePath}/assets/bootstrap/css/bootstrap.css"/>    
<link rel="stylesheet" href="${basePath}/assets/css/medical_record/home_page.css"/>
<link rel="stylesheet" href="${basePath}/assets/css/basic.css"/>
<link rel="stylesheet" href="${basePath}/assets/jquery-ui/jquery-ui.css"/>


<script type="text/javascript" src="${basePath}/assets/js/jquery/jquery.min.js"></script>
<script type="text/javascript" src="${basePath}/assets/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="${basePath}/assets/jquery-ui/jquery-ui.js"></script>
<script type="text/javascript" src="${basePath}/assets/layer/layer.js"></script>
<script type="text/javascript" src="${basePath}assets/js/echarts.js"></script>
<script type="text/javascript" src="${basePath}/assets/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${basePath}assets/js/echarts.js"></script>
<input type="hidden" id="basePath" value="${basePath }">
<form action="${basePath}/report/editOutNumsAndDeathRateForm"
	method="post" id="outDeathRateForm">
<input type="hidden" id="month" name="month" value="${month}">
<table style="width:100%;" cellpadding="0" cellspacing="0" id="table">
<tbody>
	
	<td colspan="6" style="text-align:right;">
			<input type="button" value="导出" class="btn"  onclick="exportOutEachDeptWord()">
			<input type="button" value="保存" class="btn"  onclick="saveOutEachDept()">
	</td>
	
	
			<tr >
				 <td class="tdLabel_7" style="width:60px">
				 	出院患者统计指标
				 </td>
				<td class="tdLabel_8" colspan="7" style="width:990px">
					<textarea style="width:97%;height:600px" name="text">${outHospStatisIndexInfo.text}</textarea>
				</td>
			</tr>
			
			<tr >
				 <td class="tdLabel_7" style="width:60px">
				 	说明
				 </td>
				<td class="tdLabel_8" colspan="7" style="width:990px">
					<textarea style="width:97%;height:150px" name="note" id="note">${outHospStatisIndexInfo.note}</textarea>
				</td>
			</tr>
			
			
				<tr>
				<td class="tdLabel_8" colspan="7">
					<table style="width:980px; margin:0 auto; float:left; border-collapse:collapse;" cellpadding="0" cellspacing="0">
					    <tr>
							 <td colspan="12" style="text-align:center;font-size:16px;">
									表2  ${year}年${mon}月各科室出院患者统计指标
							</td>
						</tr>
     		 			<tr>
     		 			 <td class="tdLabel_4">出院科室</td>
     		 			 <td class="tdLabel_4">出院人次数</td>
      					 <td class="tdLabel_4">死亡人数</td>
      					 <td class="tdLabel_4">出院当天再住院人数</td>
      					 <td class="tdLabel_4">平均住院天数</td>
      					 <td class="tdLabel_4">术前平均住院天数</td>
      					 <td class="tdLabel_4">术后平均住院天数</td>
      					 <td class="tdLabel_4">手术及治疗性操作人次数</td>
      					 <td class="tdLabel_4">三四级手术及治疗性操作人次数</td>
      					 <td class="tdLabel_4">患者平均住院费用</td>
      					 <td class="tdLabel_4">药占比(%)</td>
      					 <td class="tdLabel_4">一次性耗材占比(%)</td>
      					</tr>

					<c:forEach var="obj"   items="${outHospStatisIndexInfo.outHospStatisIndexRecordList}">
      					<tr>
     		 			 <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.officeName}"/></td>
     		 			 <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.outNum}"/></td>
      					 <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.deathNum}"/></td>
      					 <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.reOutHospInNum}"/></td>
      					 <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.avgInHospDays}"/></td>
      					  <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.beforeOpAvgInHospDays}"/></td>
     		 			 <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.afterOpAvgInHospDays}"/></td>
      					 <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.surgicalTherapeuticOpNum}"/></td>
      					 <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.thirdForthSurgicalTherapeuticOpNum}"/></td>
      					 <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.avgCostFee}"/></td>
      					  <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.drugProportion}"/></td>
     		 			 <td class="tdLabel_8" ><input class="input_box" type="text" style="width:95%" value="${obj.disposableConsumableProportion}"/></td>
      					</tr>
      				</c:forEach>
     				</table>
				</td>
			</tr>
			
			
			 
		
			
			
		

			
		</tbody>
</table>
	

</form>





<script>


    function saveOutEachDept(){
       
        var note = $("#note").val();
    	$.ajax({
    	    type:"post",
    	    data:{note:note},
    	    url:"${basePath}/report/saveOutPatientEachDeptInfo",
    	    success:function(data){
    	    	layer.alert(data.msg,{icon:1});
    	    	return;
    	    }
    	})
    }


     function exportOutEachDeptWord(){
     	window.location.href ="${basePath}/report/exportOutEachDeptWord";
     }

     
     //初始化图表信息
     $(function(){
		var opNumberInfoJson= <%=opNumberInfoJson%>;
		if(null!=opNumberInfoJson){
		   initCharSet(opNumberInfoJson.echartsBaseRecord1);
		   
		   initCharset1(opNumberInfoJson.echartsBaseRecord2);
		  
		  initCharset2(opNumberInfoJson.echartsBaseRecord3);
		}
		
     });
     
     
     
     function initCharset1(params){
     
     
     	var dom = document.getElementById("container1");
		var myChart = echarts.init(dom);
		var app = {};
		option = null;
		app.title = '折柱混合';

		option = {
    		tooltip: {
       		  trigger: 'axis',
      		  axisPointer: {
          	  type: 'cross',
          	  crossStyle: {
               	 color: '#999'
           	 }
       	 }
    	},
  
   		 legend: {
        		data:['手术占比','三四级手术及治疗性操作人占比']
  		 },
   		 xAxis: [
      	  {
           	  type: 'category',
          	  data: params.monthList,
          	  axisPointer: {
               	 type: 'shadow'
           	 }
        }
  	   ],
   		 yAxis: [
       	 {
            type: 'value',
            name: '占比',
            min: 0,
            max: 100,
            interval: 10,
            axisLabel: {
                formatter: '{value}'
            }
        }
   	 ],
  	  series: [
      	  {
          	  name:'手术占比',
           	  type:'bar',
          	  data:params.data1List
      	  },
      	  {
           	 name:'三四级手术及治疗性操作人占比',
           	 type:'bar',
           	 data:params.data2List
       	 }
      
    	]
	};
	;
	if (option && typeof option === "object") {
  		 myChart.setOption(option, true);
	}
     
     
     }
     
     

     
    
     //charset图表
     function initCharSet(params,arr,max,interval,id){
             
    	 var dom = document.getElementById("container");
		 var myChart = echarts.init(dom);
		 var app = {};
		 option = null;
		 app.title = '折柱混合';

		 option = {
    		tooltip: {
        		trigger: 'axis',
       			axisPointer: {
            		type: 'cross',
           			crossStyle: {
                		color: '#999'
            		}
       			 }
   			},
  
    		legend: {
        		data:params.monthList
    		},
   			xAxis: [
       		 {
            	type: 'category',
            	data: ['手术及操作人次数','手术及治疗性操作人次数','三四级手术及治疗性操作人次数'],
            	axisPointer: {
                	type: 'shadow'
            	}
       		 }
    		],
    		yAxis: [
       		 {
          		  type: 'value',
          		  name: '人数',
          		  min: 0,
          		  max: 15000,
           		 interval: 2000,
           		 axisLabel: {
              		  formatter: '{value}'
           		 }
        	 }
    		],
   		  series: [
       		 {
          		  name:params.monthList[0],
           		  type:'bar',
           		  data:params.data1List
       		 },
       		 {
           		 name:params.monthList[1],
           		 type:'bar',
           		 data:params.data2List
      		  },
       		 {
          		  name:params.monthList[2],
           		  type:'bar',
           		 data:params.data3List
        	 }
   			 ]
		};
		;
		if (option && typeof option === "object") {
    		myChart.setOption(option, true);
		}
     }
     
     
     function initCharset2(params){
     	var dom = document.getElementById("container2");
		var myChart = echarts.init(dom);
		var app = {};
		option = null;
		app.title = '折柱混合';

		option = {
    		tooltip: {
        		trigger: 'axis',
       			 axisPointer: {
          			  type: 'cross',
            			crossStyle: {
                		color: '#999'
           				 }
        		}
    		},
  
    	legend: {
        	data:params.monthList
   		 },
    	xAxis: [
        {
            type: 'category',
            data: ['手术及治疗性操作人次数','手术治疗人次数','治疗性操作人次数','诊断性操作人次数'],
            axisPointer: {
                type: 'shadow'
            },
			textStyle: {
				fontSize: 10
			}
        }
   		 ],
  	  yAxis: [
       	 {
            type: 'value',
            name: '占比',
            min: 0,
            max: 1000,
            interval: 100,
            axisLabel: {
                formatter: '{value}'
            }
        }
   	 ],
    series: [
        {
            name:params.monthList[0],
            type:'bar',
            data:params.data1List
        },
        {
            name:params.monthList[1],
            type:'bar',
            data:params.data2List
        },
		{
            name:params.monthList[2],
            type:'bar',
            data:params.data3List
        }
		
		
      
    ]
	};
	;
	if (option && typeof option === "object") {
  	  myChart.setOption(option, true);
	}
     }
     
     


 

	
</script>